<?php
@session_start();
$PurviewLevel=2;
$CheckChannelID=1;  
$PurviewLevel_Others="user_vpp_usermap";

require("../../inc/common.inc.php");
require_once("../Admin_ChkPurview.php");
$grouparr="";
$rs=$db->excu("select * from mx_user_group order by orderid asc,id asc");
if ($db->num_rows($rs)>0){
	while ($rsdb=$db->fetch_array($rs)){
		$grouparr[$rsdb["id"]]=$rsdb["groupname"];
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE>铭讯EOS网站后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<Meta name="Keywords" Content="济南网站建设 济南网站制作 山东网站建设 济南铭讯软件有限公司">
<Meta name="Description" Content="济南网站制作：铭讯软件专业服务优秀企业，致力于网站建、设网站推广、网络营销一体的全访位网络服务商">
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=5f5b39083dfc300b6359ce2d85020dea"></script>
<link rel="stylesheet" href="../images/style.css" type="text/css">
<style type="text/css">
#allmap {width:100%;;height:500px;overflow: hidden;margin:0;}
</style>
</head>
<body> 
<?php

require("../mx_head.php");

  $str=" and isguanzhu='1' ";

  if ($username!=""){
    $str.=" and username like '%$username%' ";
  }
  if ($weixinid!=""){
    $str.=" and weixinid like '%$weixinid%' ";
  }
  if ($groupid!=""){
  	$groupid=intval($groupid);
    $str.=" and groupid='$groupid' ";
  }
  if ($mobile!=""){
    $str.=" and mobile like '%$mobile%' ";
  }
  if ($isok!=""){
  	$isok=intval($isok);
    $str.=" and isok='$isok' ";
  }
  if ($sex!=""){
  	$sex=intval($sex);
    $str.=" and sex='$sex' ";
  }

  $days=intval($days);
  if ($days==0){$days=7;}
  $now=date("Y-m-d");
  if ($days==7){
  	$startdate=date("Y-m-d",strtotime("$now -7 day"));
  }
  elseif($days==30){
  	$startdate=date("Y-m-d",strtotime("$now -30 day"));
  }
  if ($startdate!=""){
  	$str.=" and lastlogintime>='$startdate 00:00:00'";
  }
?>
<div class="right">

<div class="xm2">
<h1 class="fl">VPP用户地图分布</h1>
</div>
<div class="xm2_b" style="border-bottom:0px;">
<div class="t">
<table border="0" cellpadding="0" cellspacing="1" class="search_from">
<form name="searchform1" id="searchform1" action="vpp_maps.php" method="post">
 <tr>
   <td>&nbsp;微信：</td><td><input name="weixinid" type="text" id="weixinid" value="" size="10" class="search_input"/></td>
   <td>&nbsp;手机：</td><td><input name="mobile" type="text" id="mobile" value="" size="10" class="search_input"/></td>
   <td>&nbsp;分组：</td><td>
   <select name="groupid"><option value="">不限</option><?php echo show_select($grouparr,"");?></select>
   </td>
   <td><select name="sex"><option value="">不限</option><option value="1">男</option><option value="0">女</option></select></td>
  <td><select name="isok"><option value="">不限</option><option value="1">正常</option><option value="0">锁定</option></select></td>
  <td><select name="days"><option value="-1" <?php if ($days==-1){echo "selected";}?>>不限</option><option value="7" <?php if ($days==7){echo "selected";}?>>一周内</option><option value="30" <?php if ($days==30){echo "selected";}?>>一个月内</option></select></td>
  <td><input type="submit" name="Submit3" value="搜索" class="button2" /></td>
  </tr>
</form>
</table>
</div>
<div class="height10"></div>
</div>

<div class="xm2_b">
<div id="allmap"></div>
</div>

</div>
<?php require("../mx_foot.php");?>
<div class="clear"></div>
<div class="height10"></div>
<script type="text/javascript">

// 百度地图API功能
var map = new BMap.Map("allmap");
var point = new BMap.Point(108.404, 37.915);
map.centerAndZoom(point, 5);
map.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
map.enableContinuousZoom();     //启用地图惯性拖拽，默认禁用
map.addControl(new BMap.NavigationControl());
// 编写自定义函数,创建标注
function addMarker(point,thisname){
  var marker = new BMap.Marker(point);
  map.addOverlay(marker);
  var infoWindow1 = new BMap.InfoWindow(thisname);
  marker.addEventListener("click", function(){this.openInfoWindow(infoWindow1);});
}
<?php  
  $rs=$db->excu("select * from mx_user where id>0 $str order by id desc");
  if ($db->num_rows($rs)>0){
  	while ($rsdb=$db->fetch_array($rs)){
	if (trim($rsdb["nicheng"])==""){$rsdb["nicheng"]=$rsdb["weixinid"];}
	if (trim($rsdb["nicheng"])==""){$rsdb["nicheng"]=$rsdb["weixinid"];}
?>
  var point = new BMap.Point(<?php echo $rsdb["weizhiy"];?>,<?php echo $rsdb["weizhix"];?>);
  addMarker(point,'<?php echo trim($rsdb["nicheng"]);?>');
<?php
	}
  }
?>
</script>

</body>
</html>
